﻿using System;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;

namespace TSPquestEDITOR
{
    public partial class basic_info : Form
    {
        public void load_quest_rewards()
        {

                SqlConnection qCon = new SqlConnection(connectionString);

                qCon.Open();

                //SELECT DEFAULT REWARD
                SqlCommand def_cmd = new SqlCommand(
                "SELECT default_reward_id, default_reward_quantity FROM dbo.QuestResource WHERE id = '" + fin_qID + "'",
                qCon);

                SqlDataReader def_reader = def_cmd.ExecuteReader();

                if (def_reader.HasRows)
                {
                    while (def_reader.Read())
                    {
                        quest_def_rew_id_val = def_reader.GetInt32(0);
                        quest_def_rew_amount_val = def_reader.GetInt32(1);
                    }
                }
                def_reader.Close();

           /* //SELECT OPTIONAL REWARDS
            SqlCommand opt_cmd = new SqlCommand(
            "SELECT optional_reward_id1, optional_reward_amount1, optional_reward_id2, optional_reward_amount2, optional_reward_id3, optional_reward_amount3, optional_reward_id4, optional_reward_amount4, optional_reward_id5, optional_reward_amount5, optional_reward_id6, optional_reward_amount6",
            qCon);

            SqlDataReader opt_reader = opt_cmd.ExecuteReader();

            if (opt_reader.HasRows)
            {
                while (opt_reader.Read())
                {
        
                }
            }*/
        }
    }
}
